﻿using EntityModel;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace API.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class PeopleController : ControllerBase
    {
        private readonly DWJGDbcontext? db;
        public PeopleController(DWJGDbcontext _db)
        {
            db = _db;
        }
        [HttpGet("GetAll")]
        public List<People> GetAll()
        {
            List<People> people = new List<People>();
            people = db.People.ToList();
            return people;
        }
        [HttpGet("GetByEmpty")]
        public List<People> GetByEmpty()
        {
            List<People> people = new List<People>();
            people = db.People.Where(w => w.lable_empty == true).ToList();
            return people;
        }
    }
}
